package com.fjec.market.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.fjec.common.protocol.JsonResult;
import com.fjec.market.entity.InfoSku;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 012.商品sku表 服务类
 * </p>
 *
 * @author admin
 * @since 2020-09-10
 */
public interface IInfoSkuService extends IService<InfoSku> {
    JsonResult getSkuSpuById(Long id);

    JsonResult changePrice(Long id, Integer whole, Integer retail);

    List<Map<String, Object>> getTop2SkusByShopIds(List<Long> farmerIds);

    List<Map<String, Object>> getSkusByShopIds(List<Long> farmerIds);

    List<Map<String, Object>> getSkusBySpuIDsAndMarkCodeAndBusiType(int markCode, int busiType, List<Long> spuIds, int orderBy, int dir, Page page);

    /**
     * 根据skuId列表查询商品信息，生成订单用
     *
     * @param skuIdList
     * @return
     */
    List<Map<String, Object>> getSkuInfoByIdList(List<Long> skuIdList);

    JsonResult saveSku(InfoSku sku, String spuDesc, Long userId, String skuPics, String skuVideos, String picIds, String videoId);

    JsonResult getMySkus(Long busiId);

    JsonResult deleteSku(Long skuId, Long spuId);

    int sumSkuSaleNumByBusiId(Long id);

    List<Map<String, Object>> getRetailFruits(Integer markCode, List<Long> spuIds, Integer orderBy, Integer dir, Page page);
}
